//----------------------------------------------------------------------------
//  ,-.
// /_\___ ,   Ninja Framework
// '  ___\    (C) Riccardo Capra - http://riccar.do
//  //   \\
//----------------------------------------------------------------------------
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------------

#ifndef NJ_FUNDAMENTAL_TYPES_H
#	define NJ_FUNDAMENTAL_TYPES_H

#	include "NjNinjaSyncLib.h"
#	include "NjConfiguration.h"
#	include "NjFundamentalTypes_config.h"

	/// \brief An unsigned type 1 byte long
	typedef unsigned char NjUint8;

	/// \brief An unsigned type 2 bytes long
	typedef unsigned short int NjUint16;

	/// \brief An unsigned type 4 bytes long
	typedef unsigned int NjUint32;

	/// \brief An unsigned type 8 bytes long
	typedef unsigned long long NjUint64;

	/// \brief A signed type 1 byte long
	typedef signed char NjInt8;

	/// \brief A signed type 2 bytes long
	typedef signed short int NjInt16;

	/// \brief A signed type 4 bytes long
	typedef signed int NjInt32;

	/// \brief A signed type 8 bytes long
	typedef signed long long NjInt64;

	/// \brief A char type 1 byte long (used for ISO 8859-1 and UTF-8)
	typedef char NjChar8;

	/// \brief A char type used with constant strings without prefixes
	typedef NjChar8 NjChar;

	/// \typedef NjChar16
	/// \brief A char type 2 bytes long (used for UCS2 and UTF16)

	/// \typedef NjChar32
	/// \brief A char type 4 bytes long (used for Unicode)

	/// \typedef NjCharW
	/// \brief A char type used with constant strings starting with L prefix

#if NJ_TYPES_CHAR_W_IS_16
	typedef wchar_t NjChar16;
	typedef NjInt32 NjChar32;
	typedef NjChar16 NjCharW;
#else // NJ_TYPES_CHAR_W_IS_16
	typedef NjInt16 NjChar16;
	typedef wchar_t NjChar32;
	typedef NjChar32 NjCharW;
#endif // NJ_TYPES_CHAR_W_IS_16

	/// \brief A boolean type
	typedef bool NjBool;

	/// \brief True value
	static const NjBool NJ_TRUE = true;

	/// \brief False value
	static const NjBool NJ_FALSE = false;

	/// \brief A floating point type 4 bytes long
	typedef float NjFloat32;

	/// \brief A floating point type 8 bytes long
	typedef double NjFloat64;

	/// \brief A floating point type 8 bytes long

	/// \typedef NjFloat
	/// \brief A generic size floating point type

	/// \typedef NjHashType
	/// \brief A type used for hash values

	/// \typedef NjTimeStamp
	/// \brief A type used for time

	/// \typedef NjInt
	/// \brief An unsigned point with the same bit size of the architecture

	/// \typedef NjInt
	/// \brief A signed point with the same bit size of the architecture

#	if NJ_TYPES_FLOAT_IS_64
	typedef NjFloat64 NjFloat;
#	else // NJ_TYPES_FLOAT_IS_64
	typedef NjFloat32 NjFloat;
#	endif // NJ_TYPES_FLOAT_IS_64

#	if NJ_TYPES_HASH_IS_64
	typedef NjUint64 NjHashType;
#	else // NJ_TYPES_HASH_IS_64
	typedef NjUint32 NjHashType;
#	endif // NJ_TYPES_HASH_IS_64

#	if NJ_TYPES_TIME_IS_64
	typedef NjUint64 NjTimeStamp;
#	else // NJ_TYPES_TIME_IS_64
	typedef NjUint32 NjTimeStamp;
#	endif // NJ_TYPES_TIME_IS_64

#	if NJ_PLATFORM_32_BIT
	typedef NjUint32 NjUint;
	typedef NjInt32 NjInt;
#	else // NJ_PLATFORM_32_BIT
	typedef NjUint64 NjUint;
	typedef NjInt64 NjInt;
#	endif // NJ_PLATFORM_32_BIT

#endif // NJ_FUNDAMENTAL_TYPES_H
